<template>
  <a-tag :color="statusColor">{{ statusText }}</a-tag>
</template>

<script setup lang="ts">
import { computed } from 'vue';
import { POST_STATUS, POST_STATUS_TEXT, POST_STATUS_COLOR } from '@/constants';

// 定义组件属性
const props = defineProps({
  status: {
    type: Number,
    required: true
  }
});

// 计算状态文字
const statusText = computed(() => {
  return POST_STATUS_TEXT[props.status] || '未知状态';
});

// 计算状态颜色
const statusColor = computed(() => {
  return POST_STATUS_COLOR[props.status] || 'default';
});
</script>

<style scoped>
.ant-tag {
  margin-right: 0;
  font-weight: 500;
}
</style> 